package cool.tianyou.blue.bird;

import cn.hutool.cache.Cache;
import cn.hutool.cache.impl.TimedCache;
import cool.tianyou.blue.bird.model.CommonMessage;
import cool.tianyou.blue.bird.model.Device;

import java.util.ArrayList;
import java.util.List;

public class LocalStorage {
    public static List<Device> devices = new ArrayList<>();
    public static Cache<String, CommonMessage> messageCache = new TimedCache<>(1000 * 30);

    public static void putMessage(CommonMessage message) {
        messageCache.put(message.getMessageUuid(), message);
    }

    public static CommonMessage getMessage(String messageUuid) {
        return messageCache.get(messageUuid);
    }
}
